Numeric
EOSIO Javascript / Exports / Numeric
Namespace: Numeric
Table of contents
Enumerations
Interfaces
Variables
Functions
- base58ToBinary
- base64ToBinary
- binaryToBase58
- binaryToDecimal
- convertLegacyPublicKey
- convertLegacyPublicKeys
- decimalToBinary
- isNegative
- negate
- privateKeyToLegacyString
- privateKeyToString
- publicKeyToLegacyString
- publicKeyToString
- signatureToString
- signedBinaryToDecimal
- signedDecimalToBinary
- stringToPrivateKey
- stringToPublicKey
- stringToSignature
Variables
privateKeyDataSize
• Const
privateKeyDataSize: 32
Private key data size, excluding type field
Defined in
src/eosjs-numeric.ts:273
publicKeyDataSize
• Const
publicKeyDataSize: 33
Public key data size, excluding type field
Defined in
src/eosjs-numeric.ts:270
signatureDataSize
• Const
signatureDataSize: 65
Signature data size, excluding type field
Defined in
src/eosjs-numeric.ts:276
Functions
base58ToBinary
▸ base58ToBinary(size
, s
): Uint8Array
Convert an unsigned base-58 number in s
to a bignum
Parameters
Name | Type | Description |
---|---|---|
size | number | bignum size (bytes) |
s | string | - |
Returns
Uint8Array
Defined in
src/eosjs-numeric.ts:173
base64ToBinary
▸ base64ToBinary(s
): Uint8Array
Convert an unsigned base-64 number in s
to a bignum
Parameters
Name | Type |
---|---|
s | string |
Returns
Uint8Array
Defined in
src/eosjs-numeric.ts:227
binaryToBase58
▸ binaryToBase58(bignum
, minDigits?
): string
Convert bignum
to a base-58 number
Parameters
Name | Type | Default value | Description |
---|---|---|---|
bignum | Uint8Array | undefined | - |
minDigits | number | 1 | 0-pad result to this many digits |
Returns
string
Defined in
src/eosjs-numeric.ts:201
binaryToDecimal
▸ binaryToDecimal(bignum
, minDigits?
): string
Convert bignum
to an unsigned decimal number
Parameters
Name | Type | Default value | Description |
---|---|---|---|
bignum | Uint8Array | undefined | - |
minDigits | number | 1 | 0-pad result to this many digits |
Returns
string
Defined in
src/eosjs-numeric.ts:109
convertLegacyPublicKey
▸ convertLegacyPublicKey(s
): string
If a key is in the legacy format (EOS
prefix), then convert it to the new format (PUB_K1_
).
Leaves other formats untouched
Parameters
Name | Type |
---|---|
s | string |
Returns
string
Defined in
src/eosjs-numeric.ts:373
convertLegacyPublicKeys
▸ convertLegacyPublicKeys(keys
): string
[]
If a key is in the legacy format (EOS
prefix), then convert it to the new format (PUB_K1_
).
Leaves other formats untouched
Parameters
Name | Type |
---|---|
keys | string [] |
Returns
string
[]
Defined in
src/eosjs-numeric.ts:383
decimalToBinary
▸ decimalToBinary(size
, s
): Uint8Array
Convert an unsigned decimal number in s
to a bignum
Parameters
Name | Type | Description |
---|---|---|
size | number | bignum size (bytes) |
s | string | - |
Returns
Uint8Array
Defined in
src/eosjs-numeric.ts:62
isNegative
▸ isNegative(bignum
): boolean
Is bignum
a negative number?
Parameters
Name | Type |
---|---|
bignum | Uint8Array |
Returns
boolean
Defined in
src/eosjs-numeric.ts:43
negate
▸ negate(bignum
): void
Negate bignum
Parameters
Name | Type |
---|---|
bignum | Uint8Array |
Returns
void
Defined in
src/eosjs-numeric.ts:48
privateKeyToLegacyString
▸ privateKeyToLegacyString(key
): string
Convert private key
to legacy string (base-58) form
Parameters
Name | Type |
---|---|
key | Key |
Returns
string
Defined in
src/eosjs-numeric.ts:413
privateKeyToString
▸ privateKeyToString(key
): string
Convert key
to string (base-58) form
Parameters
Name | Type |
---|---|
key | Key |
Returns
string
Defined in
src/eosjs-numeric.ts:440
publicKeyToLegacyString
▸ publicKeyToLegacyString(key
): string
Convert public key
to legacy string (base-58) form
Parameters
Name | Type |
---|---|
key | Key |
Returns
string
Defined in
src/eosjs-numeric.ts:347
publicKeyToString
▸ publicKeyToString(key
): string
Convert key
to string (base-58) form
Parameters
Name | Type |
---|---|
key | Key |
Returns
string
Defined in
src/eosjs-numeric.ts:358
signatureToString
▸ signatureToString(signature
): string
Convert signature
to string (base-58) form
Parameters
Name | Type |
---|---|
signature | Key |
Returns
string
Defined in
src/eosjs-numeric.ts:467
signedBinaryToDecimal
▸ signedBinaryToDecimal(bignum
, minDigits?
): string
Convert bignum
to a signed decimal number
Parameters
Name | Type | Default value | Description |
---|---|---|---|
bignum | Uint8Array | undefined | - |
minDigits | number | 1 | 0-pad result to this many digits |
Returns
string
Defined in
src/eosjs-numeric.ts:132
signedDecimalToBinary
▸ signedDecimalToBinary(size
, s
): Uint8Array
Convert a signed decimal number in s
to a bignum
Parameters
Name | Type | Description |
---|---|---|
size | number | bignum size (bytes) |
s | string | - |
Returns
Uint8Array
Defined in
src/eosjs-numeric.ts:87
stringToPrivateKey
▸ stringToPrivateKey(s
): Key
Convert key in s
to binary form
Parameters
Name | Type |
---|---|
s | string |
Returns
Defined in
src/eosjs-numeric.ts:388
stringToPublicKey
▸ stringToPublicKey(s
): Key
Convert key in s
to binary form
Parameters
Name | Type |
---|---|
s | string |
Returns
Defined in
src/eosjs-numeric.ts:319
stringToSignature
▸ stringToSignature(s
): Key
Convert key in s
to binary form
Parameters
Name | Type |
---|---|
s | string |
Returns
Defined in
src/eosjs-numeric.ts:451